﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Student_EditSelfData : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            //Label1.Text = Session["id"].ToString();
            Label1.Text = "98820307";
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(TextBox2.Text)) {
            SqlDataSource2.Insert();
        }
        TextBox2.Text = "";
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(TextBox3.Text)) {
            SqlDataSource3.Insert();
        }
        TextBox3.Text = "";
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Session["selectedCellPhone"].ToString()))
        {
            SqlDataSource3.Delete();
        }
        Session["selectedCellPhone"] = "";
        GridView2.SelectedIndex = -1;
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        SqlDataSource5.Insert();
        GridView3.DataBind();

        TextBox6.Text = "";
        TextBox5.Text = "";
        TextBox4.Text = "";
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
        TextBox6.Text = "";
        TextBox5.Text = "";
        TextBox4.Text = "";
    }
    protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["activityname"] = GridView3.SelectedRow.Cells[0].Text;
    }
    protected void Button7_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Session["activityname"].ToString()))
        {
            SqlDataSource4.Delete();
        }
        Session["activityname"] = "";
        GridView3.SelectedIndex = -1;
    }
    protected void Button8_Click(object sender, EventArgs e)
    {
        SqlDataSource6.Insert();
        GridView4.DataBind();

        TextBox9.Text = "";
        TextBox8.Text = "";
        TextBox7.Text = "";
    }
    protected void Button9_Click(object sender, EventArgs e)
    {
        TextBox9.Text = "";
        TextBox8.Text = "";
        TextBox7.Text = "";
    }
    protected void GridView4_SelectedIndexChanged(object sender, EventArgs e)
    {
        Session["cername"] = GridView4.SelectedRow.Cells[0].Text;
    }
    protected void Button10_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Session["cername"].ToString()))
        {
            SqlDataSource7.Delete();
        }
        Session["cername"] = "";
        GridView4.SelectedIndex = -1;
    }
}